﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaperList.aspx.cs" Inherits="dcwj.PaperList" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>调查问卷列表</title>
    <link href="css/main.css" type="text/css" rel="stylesheet">
    <link href="js/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css" />
    <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>


    <script>
        function selectMonth() {
            WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });
        }
    </script>

    <script type="text/javascript">
        function checkDate() {
            if (document.getElementById("dtEnd").value != '' &&
            document.getElementById("dtStart").value != '') {
                if (document.getElementById("dtEnd").value < document.getElementById("dtStart").value) {
                    alert("开始日期要小于结束日期");
                    return false;
                }
            }
        }
        function checkSel() {
            var n = 0;
            var checkBoxs = document.getElementsByTagName('INPUT');
            for (var i = 0; i < checkBoxs.length; i++) {
                if (checkBoxs[i].checked && checkBoxs[i].type == "checkbox") {
                    n++;
                }
            }
            if (n < 2) {
                alert("请选择要进行对比的问卷（2份以上）");
                return false;
            }
            return true;
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <br>
    <table class="usertableborder" cellspacing="1" cellpadding="3" width="96%" align="center"
        border="0">
        <tr>
            <th colspan="4">
                :::查询调查问卷:::            </th>
        </tr>
        <tr>
            <td colspan="4" class="usertablerow2"><table width="100%">
              <tr>
                <td class="usertablerow1" width="13%"> 品   牌</td>
                <td class="usertablerow1" width="20%"><asp:DropDownList ID="ddlBrand" runat="server" Width="100px"> </asp:DropDownList>
                    <div align="right"></div></td>
                <td class="usertablerow1" width="13%"><div align="center">区    域</div></td>
                <td class="usertablerow1" width="20%"><asp:DropDownList ID="ddlRegion" runat="server" Width="100px"> </asp:DropDownList>
                    <div align="right"></div></td>
                <td class="usertablerow1" width="13%"><div align="center">岗　　位</div></td>
                <td width="21%" class="usertablerow1"><asp:DropDownList ID="ddlPosition" runat="server" Width="100px"> </asp:DropDownList>
                    <div align="right"></div></td>
              </tr>
            </table></td>
        </tr>
        

          <tr>
            <td class="usertablerow2" width="25%">
                讲师所属部门            </td>
            <td class="usertablerow2" width="25%">
                <asp:DropDownList ID="ddlTGroup" runat="server" Width="100px" 
                    AutoPostBack="True" onselectedindexchanged="ddlTGroup_SelectedIndexChanged">                </asp:DropDownList>            </td>
            <td class="usertablerow2" width="25%">
                <asp:Label ID="lblTeacherNM" runat="server" Text="讲　　师"></asp:Label>            </td>
            <td class="usertablerow2" width="25%">
                <asp:DropDownList ID="ddlTeacher" runat="server" Width="100px">                </asp:DropDownList>            </td>
        </tr>


        <tr>
            <td class="usertablerow1" width="25%">
                开始日期            </td>
            <td class="usertablerow1" width="25%">
                <input class="Wdate" runat="server" id="dtStart" name="dtStart" type="text" onclick="WdatePicker()">            </td>
            <td class="usertablerow1" width="25%">
                结束日期            </td>
            <td class="usertablerow1" width="25%">
                <input class="Wdate" runat="server" id="dtEnd" name="dtEnd" type="text" onclick="WdatePicker()">            </td>
        </tr>
        <tr>
            <td class="usertablerow2" width="25%">
                <asp:Label ID="lblPType" runat="server" Text="问卷类型"></asp:Label>            </td>
            <td class="usertablerow2" width="25%">
                <asp:RadioButtonList ID="rdoPaperType" runat="server" RepeatDirection="Horizontal">                </asp:RadioButtonList>            </td>
            <td class="usertablerow2" width="25%">
                问卷名称            </td>
            <td class="usertablerow2" width="25%">
                <asp:TextBox ID="txtPaperNm" runat="server" Width="200px"></asp:TextBox>            </td>
        </tr>
    </table>
    <br/>
    <table cellspacing="1" cellpadding="3" width="96%" align="center" border="0">
        <tr>
        <td align="left">
        <input class="Wdate" runat="server" id="dtMonth" name="dtMonth" type="text" onclick="selectMonth()">
        <asp:Button ID="btnExport" runat="server" Text="导出" onclick="btnExport_Click"  />
        </td>
            <td align="center">
            
                <asp:Button ID="btnQuery" runat="server" Text="查 询 问 卷" OnClick="btnQuery_Click" />
            </td>
        </tr>
    </table>
    <br/>
    <asp:GridView ID="GridView1" runat="server" Width="96%" HorizontalAlign="Center"
        EmptyDataText="没有查询到符合条件的数据" AutoGenerateColumns="False" Style="text-align: center"
        DataKeyNames="paperID" onrowdeleting="GridView1_RowDeleting" 
        AllowPaging="True" onpageindexchanging="GridView1_PageIndexChanging" 
        ShowHeaderWhenEmpty="True">
        <Columns>
            <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="选择">
                <ItemTemplate>
                    <asp:CheckBox ID="chkItem" runat="server" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="4%"></ItemStyle>
            </asp:TemplateField>
            <asp:BoundField DataField="PaperID" HeaderText="PaperID">
            <ItemStyle Width="0px" />
            </asp:BoundField>

            <asp:BoundField DataField="PaperName" HeaderText="问卷名称">
                <ItemStyle Width="25%" Wrap="False" />
            </asp:BoundField>

             <asp:HyperLinkField DataNavigateUrlFields="PaperID" DataNavigateUrlFormatString="router.aspx?paperid={0}&viewrs=true"
                HeaderText="单班报告" Text="单班报告" Target="_blank">
                <ItemStyle Width="5%" />
            </asp:HyperLinkField>

             <asp:HyperLinkField DataNavigateUrlFields="PaperID" DataNavigateUrlFormatString="router.aspx?paperid={0}&viewrs=true&viewdata=true"
                HeaderText="导出数据" Text="导出数据" Target="_blank">
                <ItemStyle Width="5%" />
            </asp:HyperLinkField>

            <asp:BoundField DataField="PaperClassName" HeaderText="问卷类型">
                <ItemStyle Width="5%" />
            </asp:BoundField>
            <asp:BoundField DataField="BrandName" HeaderText="品牌">
                <ItemStyle Width="10%" />
            </asp:BoundField>
            <asp:BoundField DataField="RegionName" HeaderText="区域">
                <ItemStyle Width="5%" />
            </asp:BoundField>
            <asp:BoundField DataField="PositionName" HeaderText="岗位">
                <ItemStyle Width="8%" />
            </asp:BoundField>

             <asp:BoundField DataField="TeacherName" HeaderText="讲师">
                <ItemStyle Width="5%" />
            </asp:BoundField>

            <asp:BoundField DataField="StartTime" HeaderText="开始日期">
                <ItemStyle Width="6%" Wrap="True" />
            </asp:BoundField>
            <asp:BoundField DataField="EndTime" HeaderText="结束日期">
                <ItemStyle Width="6%" />
            </asp:BoundField>
            <asp:BoundField DataField="SubmitTimes" HeaderText="数量">
                <ItemStyle Width="4%" />
            </asp:BoundField>
            <asp:HyperLinkField DataNavigateUrlFields="PaperID" DataNavigateUrlFormatString="router.aspx?paperid={0}&viewrs="
                HeaderText="地址" Target="_blank" Text="链接地址">
                <ItemStyle Width="5%" />
            </asp:HyperLinkField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                        Text="删除" OnClientClick="return confirm('确认要删除该问卷以及相关数据吗？');"></asp:LinkButton>
                </ItemTemplate>
                <ItemStyle Width="4%" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle Height="25px" />
        <PagerStyle HorizontalAlign="Left" Wrap="False" />
    </asp:GridView>

    <%--每页10项，共多少项--%>
    <table cellspacing="1" cellpadding="3" width="96%" align="center" border="0">
        <tr>
            <td align="right">
                 <asp:Label ID="lblCount" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>  

    <table cellspacing="1" cellpadding="3" width="96%" align="center" border="0">
        <tr>
            <td align="center">
                 <asp:Button Text="多班对比（按班次）" runat="server" ID="btnCompareClass" 
                     onclick="btnCompareClass_Click" />
                 <asp:Button Text="讲师对比(讲师版)" runat="server" ID="btnCompareTeacher" 
                     onclick="btnCompareTeacher_Click" />
                 <asp:Button Text="多班对比（按讲师）" runat="server" ID="btnCompareTAll" 
                     onclick="btnCompareTAll_Click" />             
            </td>
        </tr>
    </table>
    <br/>
   
    </form>
</body>
</html>
